/**
 * Created with IntelliJ IDEA.
 * Description:组队竟赛
 * User: wangxin
 * Date: 2024-07-31
 * Time: 17:49
 */
import java.util.*;
public class test1 {
    // 注意类名必须为 Main, 不要有任何 package xxx 信息
    public class Main {
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            // 注意 hasNext 和 hasNextLine 的区别
            while(in.hasNext()){
                int n = in.nextInt();
                int[] arr = new int [3*n];
                for(int i = 0;i < arr.length;i++){
                    arr[i] = in.nextInt();
                }
                Arrays.sort(arr);
                long sum = 0;
                int m = arr.length - 2;
                for(int i = 0;i < n; i++){
                    sum += arr[arr.length - ((i+1) * 2)];
                }
                System.out.println(sum);
            }

        }
    }
}
